﻿<phone:PhoneApplicationPage
    x:Class="VideoMix.Views.MixVideosPopupPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:player="clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="youtubegrd"  Margin="0,0,0,0" Background="{StaticResource bipivot}">
     
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <controls:Pivot x:Name="pvtMainDetails">
            <controls:Pivot.Title>
                <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
                    <Image Style="{StaticResource DetailPagePivotTitleImage}" x:Name="imgTitle"/>
                    <TextBlock x:Name="videotitle"  TextWrapping="NoWrap" Style="{StaticResource DetailPagePivotTitle}" />
                </StackPanel>
            </controls:Pivot.Title>
        </controls:Pivot>
        
        <Grid Grid.Row="0" Margin="0,67,0,0">
            <StackPanel Orientation="Vertical">
                <player:MediaPlayer    x:Name="videoMediaElement" IsSkipBackVisible="False" IsSkipAheadVisible="False"   Margin="5,0,17,0" PositionChanged="videoMediaElement_PositionChanged_1"  MediaStarting="videoMediaElement_MediaStarting_1" RateChanged="videoMediaElement_RateChanged_1"  MediaEnded="videoMediaElement_MediaEnded_1"  MediaFailed="videoMediaElement_MediaFailed_1" AutoPlay="True" ></player:MediaPlayer>

               

             
        
            </StackPanel>
           
         
        </Grid>
        <Grid Grid.Row="1" Margin="60,4,0,0">
            <TextBlock x:Name="SaveBookMarkMessage" Visibility="Collapsed" TextWrapping="Wrap"  Text="Video mix successfully saved." FontSize="20" Foreground="White"/>
        </Grid>
        
        
        <Grid Grid.Row="2">
            <Grid>
                <StackPanel Orientation="Vertical">
                    <ListBox x:Name="listitems" Height="300"  Margin="0,-25,20,0" Padding="3,25,0,0"   HorizontalAlignment="Center" VerticalAlignment="Center" SelectionChanged="listitems_SelectionChanged_1">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <!--<WrapGrid MaximumRowsOrColumns="5"     Orientation="Horizontal"/>-->
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="0,20,0,0" >
                                    <TextBlock Text="{Binding BookMarkNo}" Margin="10,0,0,0" FontSize="20"/>
                                    <Image x:Name="imgStart"  Source="/Images/start.appbar.png" Height="32" ToolTipService.ToolTip="BookMark Start" Margin="10,0,0,0"  MouseLeftButtonDown="StartTime_Tapped_1"></Image>
                                    <TextBlock Text="{Binding StartTime}" Margin="10,0,0,0" FontSize="20"/>
                                    <Image x:Name="imgend"  Source="/Images/stop.appbar.png" Height="32" Margin="10,0,0,0" ToolTipService.ToolTip="BookMark End" MouseLeftButtonDown="EndTime_Tapped_1"></Image>
                                    <TextBlock Text="{Binding  EndTime}" Margin="10,0,0,0" FontSize="20"/>
                                    <Image x:Name="imgBookmarkDelete"  Source="/Images/detele.appbar.png" Margin="10,0,5,0" ToolTipService.ToolTip="BookMark Delete" Height="32" MouseLeftButtonDown="imgBookmarkDelete_Tapped_1"></Image>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
              
                </StackPanel>
            </Grid>
        </Grid>
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar  IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbarstart" IconUri="/Images/start.png"  Text="Start" Click="appbarstart_Click_1"/>
            <shell:ApplicationBarIconButton x:Name="appbariconEnd" IconUri="/Images/stop.png"  Text="End" Click="appbariconEnd_Click_1"/>
            <shell:ApplicationBarIconButton x:Name="appbarsave" IconUri="/Images/save.png"  Text="Save" Click="SaveForCutVideo_Tapped_1"/>
            <shell:ApplicationBarIconButton x:Name="appbariconPreview" IconUri="/Images/preview.png"  Text="Preview" Click="PreviewForCutVideo_Tapped_1"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem  x:Name="menuItem1"  Text="Delete video from mix" Click="menuItem1_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>